Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relax type of ServiceCheck enum items #6064

Merged
merged 1 commit into from
Mar 16, 2020

Conversation

florimondmanca
Copy link
Contributor

What does this PR do?

Relax the type of individual service check enum items, eg ServiceCheck.OK, etc.

Motivation

Prevent needless type checking nits such as:

status = self.OK
if <condition>:
    status = self.CRITICAL
error: Incompatible types in assignment (expression has type "Literal[1]", variable has type "Literal[0]")

Eg currently this part of the SNMP check flags red needlessly:

# Report service checks
status = self.OK
if error:
status = self.CRITICAL
if results:
status = self.WARNING

Additional Notes

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • PR title must be written as a CHANGELOG entry (see why)
  • Files changes must correspond to the primary purpose of the PR as described in the title (small unrelated changes should have their own PR)
  • PR must have changelog/ and integration/ labels attached

@codecov
Copy link

codecov bot commented Mar 16, 2020

@florimondmanca
Copy link
Contributor Author

florimondmanca commented Mar 16, 2020

Tests are failing due to unrelated reasons:

  • ClickHouse: new undocumented metrics
  • HTTP: TLS certificate of https://sha256.badssl.com/ is approaching expiration (expires in 8 days), so one of the SCs is WARNING instead of OK.
  • TLS: TLS certificate of several endpoints we call are approaching expiration (expire in 8 days), so the expiration SC is WARNING instead of OK.

So, merging, and will see if there are ways to remove flakiness on these aspects…

(Edit: clicked the "Close" button by mistake!)

@florimondmanca florimondmanca merged commit 248347b into master Mar 16, 2020
@florimondmanca florimondmanca deleted the florimondmanca/relax-servicecheckstatus-type branch March 16, 2020 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants